# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=rancid
pkgver=3.13
pkgrel=0
pkgdesc="RANCID - Really Awesome New Cisco confIg Differ"
url="http://www.shrubbery.net/rancid/"
arch="all"
license="BSD-3-Clause-No-Nuclear-License-2014"
depends="expect perl logrotate iputils"
makedepends="openssh-client cvs subversion"
install="$pkgname.pre-install"
subpackages="$pkgname-doc"
pkgusers="rancid"
pkggroups="netadm"
options="!check"
source="https://shrubbery.net/pub/rancid/rancid-$pkgver.tar.gz
	rancid-2.3.2-conf.patch
	rancid.logrotate"

build() {
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc/rancid \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-conf-install \
		--with-svn
	make
}

# does actually nothing
check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -D -m644 "$srcdir"/rancid.logrotate \
		"$pkgdir"/etc/logrotate.d/rancid
	install -d -m 0755 -o rancid -g netadm "$pkgdir"/var/rancid
	install -d -m 0755 -o rancid -g netadm "$pkgdir"/var/log/rancid
	install -d -m 0755 -o rancid -g netadm "$pkgdir"/var/log/rancid/old
}

sha512sums="2dbd8a743a03cd94b474c08b0bb1868a991353690b9f3ff2828d16a3a102ca68e4092cb07f24ec4e57c4436e6657f3f2638f890069fbbd35d6c7a34d5bd55df5  rancid-3.13.tar.gz
dbebdecb80483fff45cfdd7a541805f45ee4e180d47a79ce9b71c5aad012d6e782c9a9d29f1de0fc2b89642aeecfc90dfddb86a1e11564e30683fa55e7009d76  rancid-2.3.2-conf.patch
aefbdeb99acd6840ab7fe75602b4cec2ed07a4eb24d073a951feef22ab7e56aff098bed7e0ca042c977218a2311465780aa5e6203507da8ab43e132df9a21795  rancid.logrotate"
